﻿@model IEnumerable<YogaStudio.Data.Domain.Course>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()


    <div class="form-horizontal">
        <h5>
            Search:@Html.TextBox("keyword")
            <input type="submit" value="Search" />
        </h5>

    </div>
}
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.CourseCode)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CourseName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CourseDescription)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CourseCode)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CourseName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CourseDescription)
        </td>
        <td>
            @Html.ActionLink("Register", "RegisterCourse", new { CourseId = item.Id })
        </td>
    </tr>
}

</table>
